<?php

/**
 * Description of GoodsModel
 *
 * @author XIAYUANCHUAN
 */

namespace Qwadmin\Model;

use Think\Model\RelationModel;

class OrderModel extends RelationModel {

    protected $tableName = 'order';
    
    protected $_link = array(
        'Order_line' => array(
            'mapping_type' => self::HAS_MANY,
            'class_name' => 'Order_line',
            'foreign_key' => 'order_id',
            'mapping_name' => 'order_line',
            'mapping_order' => 'create_time desc',
        // 定义更多的关联属性
        ),
        'Order_payment' => array(
            'mapping_type' => self::HAS_ONE,
            'class_name' => 'Order_payment',
            'foreign_key' => 'order_id',
            'mapping_name' => 'order_payment',
//            'mapping_order' => 'create_time desc',
        // 定义更多的关联属性
        ),
    );

    function __construct($name = '', $tablePrefix = '', $connection = '') {
        parent::__construct($name, $tablePrefix, $connection);
    }

}
